package net.csdn.business.common.constant;

import net.csdn.business.common.enums.AuditEnum;

import java.util.HashMap;
import java.util.Map;

/**
 * @author likun
 * @date 2022/6/30 17:53
 */
public class AuditConstants {
    public static final String VERTICAL_LINE = "|";
    public static final String DEFAULT_USERNAME = "admin";
    public static final String REPORT = "report";
    public static final String COMPANY = "atomgit";
    public static final String TYPE = "atomgit";

    public static final String AUDIT_MODE = "auditMode";

    public static final String REPORT_AUDIT_MODE = "REPORT";
    public static final String REPORT_UID = "reporterId";

    /**
     * 审核状态字段
     */
    public static final String FIELD_AUDIT_STATUS = "audit_status";
    public static final String FIELD_BEAN_AUDIT_STATUS = "auditStatus";


    /**
     * 用户详情-审核相关字段
     */
    public static final String FIELD_USER_AUDIT_STATUS = "checkStatus";
    public static final String FIELD_USER_USER_ID = "id";
    public static final String FIELD_ORG_USER_ID = "createdBy";

    /**
     * 先发后审策略
     */
    public final static Map<Integer, Boolean> SEND_FIRST = new HashMap<Integer, Boolean>() {
        {
            // 初始状态
            put(AuditEnum.AuditStatusEnum.INIT.getCode(), Boolean.TRUE);
            // 待审核、审核中
            put(AuditEnum.AuditStatusEnum.AUDITING.getCode(), Boolean.TRUE);
            // 通过
            put(AuditEnum.AuditStatusEnum.PASS.getCode(), Boolean.TRUE);
            // 复核中
            put(AuditEnum.AuditStatusEnum.REVIEW.getCode(), Boolean.TRUE);
            // 失败
            put(AuditEnum.AuditStatusEnum.FAIL.getCode(), Boolean.FALSE);
            // 删除
            put(AuditEnum.AuditStatusEnum.DELETE.getCode(), Boolean.FALSE);
        }
    };

    /**
     * 先审后发策略
     */
    public final static Map<Integer, Boolean> AUDIT_FIRST = new HashMap<Integer, Boolean>() {
        {
            // 初始状态
            put(AuditEnum.AuditStatusEnum.INIT.getCode(), Boolean.FALSE);
            // 待审核、审核中
            put(AuditEnum.AuditStatusEnum.AUDITING.getCode(), Boolean.FALSE);
            // 通过
            put(AuditEnum.AuditStatusEnum.PASS.getCode(), Boolean.TRUE);
            // 复核中
            put(AuditEnum.AuditStatusEnum.REVIEW.getCode(), Boolean.FALSE);
            // 失败
            put(AuditEnum.AuditStatusEnum.FAIL.getCode(), Boolean.FALSE);
            // 删除
            put(AuditEnum.AuditStatusEnum.DELETE.getCode(), Boolean.FALSE);
        }
    };
}